package com.owen.spring.cloud.seata.at.controller;

import com.owen.spring.cloud.seata.at.entity.StorageTbl;
import com.owen.spring.cloud.seata.at.service.StorageTblService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/storage")
public class StorageTblController {

    @Autowired
    private StorageTblService storageTblService;

    @GetMapping("/test")
    public List<StorageTbl> test(){
        return storageTblService.list();
    }

    @PostMapping("/save")
    public boolean save(@RequestBody StorageTbl storageTbl){
        return storageTblService.save(storageTbl);
    }

}
